UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2GkCBQSJPbSArYBNcRVpWFyR5Z9NH9+9IIW1/8X3VEI='
WHERE
key_id = '3ae519161403b00e146de891811662d6229a349d5a85909f6ca7f577693939c3'
AND (
token = '2GkCBQSJPbSArYBNcRVpWFyR5Z9NH9+9IIW1/8X3VEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)