UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I2YILdC58SMRBvksxlX2iUA8siQ+/BI/GwcBd/uc+kA='
WHERE
key_id = 'f733ee60657e6cf7f85c0e1acc5e97f7613f1dc811f5bf521ad9041bfcfa364c'
AND (
token = 'I2YILdC58SMRBvksxlX2iUA8siQ+/BI/GwcBd/uc+kA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)