UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/JfvfzoeoDyBgEuKfes1KbDRcC+JimTkkHhB49wzCls=' 
WHERE 
  key_id = '29dec515bda8da51963428c70328b17fb44f042fbd4909c508c0bb2f5268c0ac' 
  AND (
    token = '/JfvfzoeoDyBgEuKfes1KbDRcC+JimTkkHhB49wzCls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044