UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vnF4GJ5xvW5z89QcvGPJck8NTw3zIR58zzkU3/J2DrQ=' 
WHERE 
  key_id = '9818ff59adf4371b8d3afeebb0dbcaba85bf47661faa81b49bb80a4308189c85' 
  AND (
    token = 'vnF4GJ5xvW5z89QcvGPJck8NTw3zIR58zzkU3/J2DrQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027