UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jQZRm7n86jc507uwpVk9SsD3Mmid6ucuSjkoYeMXEq8='
WHERE
key_id = 'b9c43aa73000e480eb5fe5534d5e2bd24a1514c30cff3e6e9c9de0feb0f51c5f'
AND (
token = 'jQZRm7n86jc507uwpVk9SsD3Mmid6ucuSjkoYeMXEq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)