UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wzNKKsbXHHnSdh01HO4Er8iPxT3XNHfZYKRQ6g00/1c='
WHERE
key_id = 'e2e09e4e3f62d7c97b016c59623a461ce7f3fa745c08b96f841eaee1af568f2c'
AND (
token = 'wzNKKsbXHHnSdh01HO4Er8iPxT3XNHfZYKRQ6g00/1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)