UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7cqbAaMEQwbm1NhSmXJztMsDhJnsB+8x7V1WT/1FsRM='
WHERE
key_id = '4bc0cc4e2c35a5c465f71188b1c93e80bb1b80b1fc5c27694350c4fa7b75341b'
AND (
token = '7cqbAaMEQwbm1NhSmXJztMsDhJnsB+8x7V1WT/1FsRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)