UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2alOpJe7xHnF/MPSxQ09WzHIU3PO+8B8urb3uYt0UBE=' 
WHERE 
  key_id = '608e867c5e7296999c102e1c8df3e803a5d15a5d5ab15fb23d510aed9a6a05bc' 
  AND (
    token = '2alOpJe7xHnF/MPSxQ09WzHIU3PO+8B8urb3uYt0UBE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023