UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6IP1hHvNbgLRjy5hEC27Swtgwhv+AXJjHUJBTMNYoDI='
WHERE
key_id = 'bae587539facbe916e6c8b0ce7e26838cfa926bdb4d3c13a056a3c449d436a7e'
AND (
token = '6IP1hHvNbgLRjy5hEC27Swtgwhv+AXJjHUJBTMNYoDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)