UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yqwO+y+BQJZIGnULfu+s1AufrW1YJXG95Zg3IQdxm4w=' 
WHERE 
  key_id = '5e565453a12faad76fbcf21be6203ab694dffd02e35658ae607487a44f42a1fd' 
  AND (
    token = 'yqwO+y+BQJZIGnULfu+s1AufrW1YJXG95Zg3IQdxm4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045