UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Us+plCXnq0hK+2/PTnxBHZ48Pw6z4GPkMB+jrel3GaQ='
WHERE
key_id = 'edef05663c726fe5c1ff3a00540ee9b0475575202d9893ca4f5492919310a2f6'
AND (
token = 'Us+plCXnq0hK+2/PTnxBHZ48Pw6z4GPkMB+jrel3GaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)