UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '72lfQ5ZumzqKhM3lEqHadG0w537ruBO4dx4vXk6wkV8='
WHERE
key_id = '00a8f07a5aa0f97d2a94f2eb9037ae11c04d49c3f6b3637ba44320de8133e5ac'
AND (
token = '72lfQ5ZumzqKhM3lEqHadG0w537ruBO4dx4vXk6wkV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)