UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BnjkZ17t9+3y5FcltPZIqmX+FXiePMBpuY5SuAfP9rE='
WHERE
key_id = 'b8134d53efc1fb2702d47bc811e51c7195ad5151d67d1e6ae89732f9c7555880'
AND (
token = 'BnjkZ17t9+3y5FcltPZIqmX+FXiePMBpuY5SuAfP9rE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)