UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2+J5eFMQYfuAXKYi9cW9fPnerfRwqR7OlYlD8RpVIKo=' 
WHERE 
  key_id = '2df5ba1f0f544eeac5ebdf6272bd1ae3aa86f35ee044d1f4247d905947063d84' 
  AND (
    token = '2+J5eFMQYfuAXKYi9cW9fPnerfRwqR7OlYlD8RpVIKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032