UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D2ZWpDZhuXo2rei9I1uctiqdOyrMc+eTARQOKfWUL5I='
WHERE
key_id = '0809fff1d28670ed55aedacb05b4918939db09ec9d8f938af25cbfb3d9c85983'
AND (
token = 'D2ZWpDZhuXo2rei9I1uctiqdOyrMc+eTARQOKfWUL5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)