UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K4pwx2H/uD5DgqjvOHnbDIAZG8WSi4SoZtbQLbe2GLA='
WHERE
key_id = '44ca39c59eb9f348b7250e4c1385aaa04c0f783b5c18e64d0ae6a12955890888'
AND (
token = 'K4pwx2H/uD5DgqjvOHnbDIAZG8WSi4SoZtbQLbe2GLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)