UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ayb61X4JRrBHm0my9rHIQL/s/1azYo4SGz3TXDX6qVw=' 
WHERE 
  key_id = 'f6a5487aedb358358b9ed0c7fe26a5c0ae7c5c6f009c7f4db7c3098a28714764' 
  AND (
    token = 'ayb61X4JRrBHm0my9rHIQL/s/1azYo4SGz3TXDX6qVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041