UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zjC8tLggcpE6sXo4n70/+N/A2IeXacSFztVSHyk3eLY=' 
WHERE 
  key_id = '6120b1ca17d06f962394b59cb80dde3f52fcb1abe234d7a247d865f218c16b19' 
  AND (
    token = 'zjC8tLggcpE6sXo4n70/+N/A2IeXacSFztVSHyk3eLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040