UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gxCDXe92YgV6QAfUdmSpQ1S6M/GVUNuRJ4D2dK55uAc='
WHERE
key_id = '6cf79b482d29e29b06178035c52fa7d61af51a49e64878adb132e8b9c4645f08'
AND (
token = 'gxCDXe92YgV6QAfUdmSpQ1S6M/GVUNuRJ4D2dK55uAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)