UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+9f2dHtzh9knoj5JDgev06c104cUB/zcJFYDACI5cMc='
WHERE
key_id = 'd6dcae09047cdaac89aef489fb21269bb1eedd1410e19339473f2dfa1e312aba'
AND (
token = '+9f2dHtzh9knoj5JDgev06c104cUB/zcJFYDACI5cMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)