UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HVf/e8VM/qwvMc9FD1qi6pTjqsI7Ae7x/7nL0kb+/qc=' 
WHERE 
  key_id = 'f40c2a3029de8cce5a316a22fe15d95fa863d6c727cba1c172c3cc0516011638' 
  AND (
    token = 'HVf/e8VM/qwvMc9FD1qi6pTjqsI7Ae7x/7nL0kb+/qc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054