UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hqHsE0SQj9pzoRGsXg1OAtuhPlW2jvVLwcNFZOR/rvM=' 
WHERE 
  key_id = 'd1bfe8ec7b52845e6a757feba09e7f03f9b6c1967a3c0d24f430171246210e83' 
  AND (
    token = 'hqHsE0SQj9pzoRGsXg1OAtuhPlW2jvVLwcNFZOR/rvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056