UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E+ughU1j/wnSYyCEKmBRsuqwNByrXjdJystlo88XzbQ='
WHERE
key_id = 'dd6659abf4d09026962687cc3cd2edd75b6ff7886f544ee7c51ba862cffba3e1'
AND (
token = 'E+ughU1j/wnSYyCEKmBRsuqwNByrXjdJystlo88XzbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)