UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y0t5YkaxQYoK79v/PRlduAnpU9WNv+2mETdfINTM2Tw=' 
WHERE 
  key_id = '0e3439be00dff7455327bc65f645c2edaf97dfb0079b62d49cdc54064c478805' 
  AND (
    token = 'y0t5YkaxQYoK79v/PRlduAnpU9WNv+2mETdfINTM2Tw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044