UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H3eJ0a+vtEjpzhAxIE1Q6/n2i7m+9WNs4pJMViN27YE='
WHERE
key_id = '3d4486ce9c63f9cd17569076954c7e19a70b64d4b4d50e68944f59af63dbeeda'
AND (
token = 'H3eJ0a+vtEjpzhAxIE1Q6/n2i7m+9WNs4pJMViN27YE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)