UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'chjG7JC0rtZSOf9gvtrBL1Ebf+axeFnfGG+yrXFwFI8=' 
WHERE 
  key_id = '159a4a4e8a323d6bec54350dc3ab154e6084ffa752edf4370251db49eadda4c0' 
  AND (
    token = 'chjG7JC0rtZSOf9gvtrBL1Ebf+axeFnfGG+yrXFwFI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054