UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5bFra2Y5rWoTb8RxBOKunHuDvpyR+mpNqZefhjJJve4=' 
WHERE 
  key_id = '27bde833b3c8cf7a5938b99ffc98f1dad18e9d2d58d9725e8d534c8880cb90c7' 
  AND (
    token = '5bFra2Y5rWoTb8RxBOKunHuDvpyR+mpNqZefhjJJve4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033