UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lCGtEP/sLCCqs9BbUg3ZTd5/ETQIPqFEPChVLWfVrDo='
WHERE
key_id = '22da878ba75355183e362bc03c571c27d6ca5f1c7d194af5433f5280db5ed2fc'
AND (
token = 'lCGtEP/sLCCqs9BbUg3ZTd5/ETQIPqFEPChVLWfVrDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)