UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wcaiK3xeqVGCF7vMZSKiC1aiOd+Fs7sR9qTO1bdWBjo='
WHERE
key_id = 'dd8a8a37b1b9e0768415b46970e77949646337e78f1c05b9ada98e54c8f971f2'
AND (
token = 'wcaiK3xeqVGCF7vMZSKiC1aiOd+Fs7sR9qTO1bdWBjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)