UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W9XNLyBpq2nVNPIqDZjQfNIqO/QzG8RsW9vApPTTyAk='
WHERE
key_id = '575814f51778b043cb7841700eff23858c066757d786205f4571229da9972d08'
AND (
token = 'W9XNLyBpq2nVNPIqDZjQfNIqO/QzG8RsW9vApPTTyAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)