UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EO4P6wqZ4rgHFxVwYmyEk/mRGU0KAgMw+AB7VOQgzxY='
WHERE
key_id = '5152c6dc637362e0d6ea1d9c9ac0dd40217591e5f8539ced6254bf56666ad22d'
AND (
token = 'EO4P6wqZ4rgHFxVwYmyEk/mRGU0KAgMw+AB7VOQgzxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)