UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lNJat/J5RMpc38U9Y+sH0i/RrmMX1qmmT5Ix5Wf78mM='
WHERE
key_id = '5d8e70eab4cdae00643efed1b60c0c7113fb28556dade6d83bc44a3d15fcedcd'
AND (
token = 'lNJat/J5RMpc38U9Y+sH0i/RrmMX1qmmT5Ix5Wf78mM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)