UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vsic9NkLeI+22b4Q6vdPQ66szI/HkHL5yzCs3RbWrFo=' 
WHERE 
  key_id = '51e35fdaba7667166b4ee7598dd76584581768f950f80166dbeba956d918be45' 
  AND (
    token = 'vsic9NkLeI+22b4Q6vdPQ66szI/HkHL5yzCs3RbWrFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031