UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IDSML185WzkzJshf3VQbItHSCB7J4c/PlIia5a6lWJ4=' 
WHERE 
  key_id = '56112eef66588f968a88b6f0ea9252653b700f6d34907f2cc1fed8d7bf69a6c1' 
  AND (
    token = 'IDSML185WzkzJshf3VQbItHSCB7J4c/PlIia5a6lWJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039