UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '62UBXmdoIrXMAvMoNCuD2wsr+8wdxQZ5VS6moG5mA5o=' 
WHERE 
  key_id = '5c4e01d42e53d89d9edb8b287d7fd23ce9c4b50c0bf36150c798374deb3c389b' 
  AND (
    token = '62UBXmdoIrXMAvMoNCuD2wsr+8wdxQZ5VS6moG5mA5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018