UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u+EAIhDi8KFS8bLnVSY19rD/HfSkEq7FdiBUwvkZero=' 
WHERE 
  key_id = '0f5dc69cb7448b3f29e81a8a747f1d111ee6949712b9f466edb9f022d7035a75' 
  AND (
    token = 'u+EAIhDi8KFS8bLnVSY19rD/HfSkEq7FdiBUwvkZero=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035