UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xox86BEDj1liZUNp4jcz0UqaxtUSJ04TMmk0y7sBHgw='
WHERE
key_id = '3ad6f60ec1ef81a5ca5bec7381ddc3083bee053a1279d85eb89fe9131e01e771'
AND (
token = 'xox86BEDj1liZUNp4jcz0UqaxtUSJ04TMmk0y7sBHgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)