UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Oc/Asd6T0y9BsQUEkgHAPxc5VwH60BYTTyCwrautTg='
WHERE
key_id = '301bdb62bf0475c620c9e9be545939506f3e8cdaa9302e0aa46b3bb83ebb3f31'
AND (
token = '3Oc/Asd6T0y9BsQUEkgHAPxc5VwH60BYTTyCwrautTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)