UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6w1aih1lBpWRaGXxfV9/gJd/1xeF13mEvzS+vL9Ve8Y=' 
WHERE 
  key_id = '470b4d8d1c6854a7ada2a06c283831d114df8f411c8b5f4ac7a2d7cf5fb109ca' 
  AND (
    token = '6w1aih1lBpWRaGXxfV9/gJd/1xeF13mEvzS+vL9Ve8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027