UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QowtOUvQL0CGWoxokq7GZGEQtvVsSOW2dlg8+2oE5cc='
WHERE
key_id = '5b93958c098910abce8a0ceb8a39f3a4f2d631b856c1dac2595e4103cd651a32'
AND (
token = 'QowtOUvQL0CGWoxokq7GZGEQtvVsSOW2dlg8+2oE5cc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)