UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eROsv28gDpOpKpG/txdLoekrSS0g9HW74AalQA7dXYQ=' 
WHERE 
  key_id = '0c1cde0b4190ceda513757dd4b57a60078737c944fdae3588e4eb4f91bfb47ba' 
  AND (
    token = 'eROsv28gDpOpKpG/txdLoekrSS0g9HW74AalQA7dXYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045