UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QTg5vnx4+W8xIUj4mDa9v/YqCTRm/n1i5+BSPTIWC9Y='
WHERE
key_id = '5cba2500e4f5b01a996be24cad6dcda242b858caef3d4557e72b0f33257fcb70'
AND (
token = 'QTg5vnx4+W8xIUj4mDa9v/YqCTRm/n1i5+BSPTIWC9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)