UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '13b5KWoUTwj/Z91VuqPj2eGPEbM46xYqI/rxA2ixPZk='
WHERE
key_id = '03bac7255f4a15e4777467c4015bb7f1f0b7ced641efbbaa610bb93233a6c740'
AND (
token = '13b5KWoUTwj/Z91VuqPj2eGPEbM46xYqI/rxA2ixPZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)