UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5fyb3wih30neyOaNr7pVtskk3TDei08bW6dTnfbgBS0='
WHERE
key_id = '9acb20ecf17a3fb96d8f359438bc522310c49593724e62ce9ae758463e8485c2'
AND (
token = '5fyb3wih30neyOaNr7pVtskk3TDei08bW6dTnfbgBS0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)