UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VtW6zf/rdD3gHbGbtt+tld1kiciaE2UdGCaXaWaEb7E=' 
WHERE 
  key_id = '43b4febe362458f0921973e202ca54afa1d3f533f7e63fea9d335003e5f33139' 
  AND (
    token = 'VtW6zf/rdD3gHbGbtt+tld1kiciaE2UdGCaXaWaEb7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00130