UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hs07cA6RKAPcy+P7uyPicvqt7dVUKJQfMxXpJWI/U6o='
WHERE
key_id = '972a94cf0e194b890af37ce5881be50b454e262cebad49ecd611b184ff370c1c'
AND (
token = 'Hs07cA6RKAPcy+P7uyPicvqt7dVUKJQfMxXpJWI/U6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)