UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gN5SykMgNdug9WlKG2aB/Irbtza2qimYLPbsXPc0TsQ=' 
WHERE 
  key_id = 'f06a79d41b5c4e7d1f538cc54059ecef1e7ca89926fffae33ea0136838f7f6b3' 
  AND (
    token = 'gN5SykMgNdug9WlKG2aB/Irbtza2qimYLPbsXPc0TsQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068