UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pKbR8O4V1KEoRZgsA0/Vj4KuZamiLTom3A9GzZjNZjs=' 
WHERE 
  key_id = '4380a9d8b8b1e35b3b651ced519c3aa6c6262efe357687238b32a0fcdeae3a5e' 
  AND (
    token = 'pKbR8O4V1KEoRZgsA0/Vj4KuZamiLTom3A9GzZjNZjs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042