UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rSqQhRi2QdIZS0kjQlV9vl282/E/CGsRcJeDnm/XXb0='
WHERE
key_id = 'df02eff1182eeea3400adacbdfcaa0c88951a223ddf13b83f57a70d9b2054e8c'
AND (
token = 'rSqQhRi2QdIZS0kjQlV9vl282/E/CGsRcJeDnm/XXb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)