UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1GcuV4sZY89DrrRLeOcqRSiKgvo44ZLCmhdQ8t2uDJA='
WHERE
key_id = '71a497483ba8c874049db1694c05f163f94ad0905c0de37b08ea0bffdc6d26da'
AND (
token = '1GcuV4sZY89DrrRLeOcqRSiKgvo44ZLCmhdQ8t2uDJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)