UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ibBbLBcKgau0E+yfWU8j90wv/GRxIRpoi9FDDDx8zs=' 
WHERE 
  key_id = '63ad30998e9e5db82c529623307f4db4f22960785f6574786793a8a4143377ac' 
  AND (
    token = '4ibBbLBcKgau0E+yfWU8j90wv/GRxIRpoi9FDDDx8zs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021