UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7kzqDPEnOfL++IZybRXRty5jg+pXgYUThY7epO74El0='
WHERE
key_id = '160e054298e7a05e09bf73172ed55c93630bf4d5917687cd34f295e01aba1b67'
AND (
token = '7kzqDPEnOfL++IZybRXRty5jg+pXgYUThY7epO74El0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)